package com.atguigu.juc.t8;

public class T1 {
    public static void main(String[] args) {
        Restaurant restaurant = new Restaurant();

        new Thread(()->{
            for (int i = 0; i < 10; i++) {
                restaurant.cut();
            }
        },"切菜师傅").start();

        new Thread(()->{
            for (int i = 0; i < 10; i++) {
                restaurant.cook();
            }
        },"炒菜师傅").start();

        new Thread(()->{
            for (int i = 1; i <= 10; i++) {
                restaurant.send();
                System.out.println("已经完成" + i + "道菜");
            }
        },"传菜师傅").start();
    }
}
